package common;

import hdf5.gui.BoardFrame;
import hdf5.parser.Array2DCreator;
import hdf5.parser.DataDivider;
import hdf5.parser.HDF5Parser;

import java.util.List;
import java.util.logging.Logger;

public class HDF5Main {

    private static final Logger logger = Logger.getLogger("common.HDF5Main");

    public static void main(String[] args) {
        CLIParameters parameters = CLIReader.readCLI(args);
        HDF5Parser parser = new HDF5Parser();
        Array2DCreator creator = new Array2DCreator(parameters.getxSize(), parameters.getySize());
        double[][] data = parser.readHDF5Array(parameters.getFileName(), parameters.getDataSetName());
        DataDivider dataDivider = new DataDivider(data);
        dataDivider.setTCountRowCount(data[0].length, data.length);
        List<double[]> dateList = dataDivider.divideDataByDate();
        List<double[][]> list = creator.get2DList(dateList);
        Range range = dataDivider.getMaxMinValue();
        BoardFrame frame = new BoardFrame(parameters.getxSize(), parameters.getySize(), list, range.getMin(), range.getMax());
    }
}